/*
 * @Copyright: 2025 Copyright (C) AMCAX, All rights reserved.
 * @Author: Zhang
 * @Date: 2025/7/29 19:07
 * @LastEditTime: 2025/7/29 19:07
 * @LastEditors: Zhang
 * @Description:
 */
/*
 * @Copyright: 2025 Copyright (C) AMCAX, All rights reserved.
 * @Author: Zhang
 * @Date: 2025/7/29 17:44
 * @LastEditTime: 2025/7/29 17:44
 * @LastEditors: Zhang
 * @Description:
 */
import { i18n } from '@/common/utils';
import { RJSFSchema, UiSchema } from '@rjsf/utils';
import { CollapseTemplate } from 'nextcae-base';
import { SelectionPickField } from '@/components/FieldTemplate/SelectionPickField';

export const schema: RJSFSchema = {
  type: 'object',
  properties: {
    Selection: {
      type: 'object',
      title: i18n.t('public.Selection'),
      properties: {
        Source: {
          title: '点云',
          type: 'array',
          maxItems: 1,
          ...{
            'x-options': ['pointCloud'],
          },
        },
      },
    },
  },
};

export const uiSchema: UiSchema = {
  Selection: {
    'ui:FieldTemplate': CollapseTemplate,
    'ui:layout': [1, 2],
    'ui:options': {
      label: false,
    },
    Source: {
      'ui:field': SelectionPickField,
      'ui:focused': true, // 聚焦字段，会自动聚焦到该字段
    },
  },
};
